////////////////////////////////////////////////////////////////////
// gewRec2D
function gewRec2D(minx,maxx,miny,maxy)
{
  if(minx)
  {
    this.minx = minx;
    this.miny = miny;
    this.maxx = maxx;
    this.maxy = maxy;
  }
  else
  {
    this.minx = 0;
    this.miny = 0;
    this.maxx = 0;
    this.maxy = 0;
  }
}
gewRec2D.prototype = {
  isContainRec2D:function(box)
  {
    var minx = this.minx;
    var miny = this.miny;
    var maxx = this.maxx;
    var maxy = this.maxy;
    
    var minx2 = box.minx;
    var miny2 = box.miny;
    var maxx2 = box.maxx;
    var maxy2 = box.maxy;
    if( minx >= maxx2 || minx2 >= maxx ||
        miny >= maxy2 || miny2 >= maxy ) 
    {
      return GEW_OUT;  
    }
    if( minx2 >= minx && maxx2 <= maxx &&
        miny2 >= miny && maxy2 <= maxy )
    {
      return GEW_IN;
    }
    if( minx >= minx2 && maxx <= maxx2 &&
        miny >= miny2 && maxy <= maxy2 )
    {
      return GEW_INTERNAL;
    }
    return GEW_INTERSECT;
  }
}
//
/////////////////////////////////////////////////////////////////////
